import { configureStore } from "@reduxjs/toolkit";
import { useDispatch } from "react-redux";
import user from "../pages/user/store";
import layout from "../layout/store";
import theadersModal from "../components/TheadersModal/store";
import ProductRiceText from "../pages/product/components/productRiceText/indexstore";

const store = configureStore({
  reducer: {
    user,
    theadersModal,
    ProductRiceText,
    layout,
  },
});

// 额外
export type RootState = ReturnType<typeof store.getState>;
export type AppDispatch = typeof store.dispatch;
export const useAppDispatch: () => AppDispatch = useDispatch;

export default store;
